# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import db
import Queue
class MoviePipeline(object):
    def process_item(self, item, spider):
        return item

class BlogPipeline(object):
    def process_item(self, item, spider):
        if item:
            if item['title'] and item['time']:
                param = (item['title'].encode('utf-8'), item['time'].encode('utf-8'))
                db.connect().insert("insert into blog (title,ctime) values(%s, %s)", param)
        else:
            print 111

        return item